package cn.tedu.sp09.feign;

import cn.tedu.sp01.pojp.User;
import cn.tedu.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "user-service",fallback = UserClientFB.class)
public interface UserClient {
    @GetMapping("/{userId}")
    JsonResult<User> getUser(@PathVariable("userId") Integer userId);
    @PostMapping("/{userId}/score") //....?score=1000
    JsonResult<?> addScore(@PathVariable("userId") Integer userId,
                           @RequestParam("score") Integer score);
}
